package com.xyhy.core.enums;

import java.util.Arrays;
import java.util.Objects;

import lombok.AllArgsConstructor;
import com.xyhy.core.base.ToolConstant;

import lombok.Getter;
import com.xyhy.core.base.enums.BaseTagEnum;

@Getter
@AllArgsConstructor
public enum EGender implements BaseTagEnum {
  MALE("男", ToolConstant.TAG_TYPE.PRIMARY), //
  FEMALE("女", ToolConstant.TAG_TYPE.SUCCESS), //
  ;

  private String text;
  private String tagType;

  public static EGender valueOfByName(String name) {
    if (Objects.isNull(name)) return null;
    return Arrays.stream(EGender.values()).filter(x -> x.name().equals(name)).findFirst().orElse(null);
  }

}
